/*
 ------------------------------------------------------------------------------
 Copyright (C) 1996-2001 Id Software, Inc.

 This file is part of the Quake source code.

 The Quake source code is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or (at your
 option) any later version.

 The Quake source code is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 more details.

 You should have received a copy of the GNU General Public License along with
 the Quake source code; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ------------------------------------------------------------------------------
*/


//
// plane.cpp - plane math library
//


#include "../shared.h"


glqPlane		plane_origin(0.0f, 0.0f, 0.0f, 0.0f);


/*
 ==================
 glqPlane::ToVec4
 ==================
*/
glqVec4 glqPlane::ToVec4 (void) const {

	return glqVec4(a, b, c, d);
}

/*
 ==================
 glqPlane::FromVec4
 ==================
*/
void glqPlane::FromVec4 (const glqVec4 &vec){

	a = vec.x;
	b = vec.y;
	c = vec.z;
	d = vec.w;
}

/*
 ==================
 glqPlane::ToString

 This is just a convenience function for printing planes
 ==================
*/
const char *glqPlane::ToString (int precision) const {

	return Str_FromFloatArray(ToFloatPtr(), 4, precision);
}